package com.wanmait.translate.administration.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wanmait.translate.administration.mapper.AdministrationHotelMapper;
import com.wanmait.translate.administration.service.AdministrationHotelService;
import com.wanmait.translate.pojo.AdministrationHotel;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class AdministrationHotelServiceImpl implements AdministrationHotelService {
    @Resource
    private AdministrationHotelMapper administrationHotelMapper;
    @Override
    public void insert(AdministrationHotel object) {
        administrationHotelMapper.insertSelective(object);
    }

    @Override
    public void update(AdministrationHotel object) {
        administrationHotelMapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public AdministrationHotel selectOne(Integer id) {
        return administrationHotelMapper.getAdministrationHotelById(id);
    }

    @Override
    public List<AdministrationHotel> selectList() {
        return null;
    }

    @Override
    public List<AdministrationHotel> selectList(AdministrationHotel object) {
        return null;
    }

    @Override
    public PageInfo<AdministrationHotel> listAllByPage(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return new PageInfo<>(administrationHotelMapper.ListAll(),9);
    }

    @Override
    public PageInfo<AdministrationHotel> listAllByname(Integer page, Integer pageSize, String name) {
        PageHelper.startPage(page,pageSize);
        return new PageInfo<>(administrationHotelMapper.ListAllByName(name),9);
    }

    @Override
    public PageInfo<AdministrationHotel> listAllByHotel(Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        return new PageInfo<>(administrationHotelMapper.listAllByHotel(),9);
    }

    @Override
    public PageInfo<AdministrationHotel> listAllByNotHotel(Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        return new PageInfo<>(administrationHotelMapper.listAllByNotHotel(),9);
    }
}
